package ru.rchervot.sanasar.client.view;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;

public class SelectedNoneView extends Composite 
implements SelectedNonePresenter.Display{
	private VerticalPanel basePanel = new VerticalPanel();
	private final Label selectedNoneLabel = new Label();
	private Presenter presenter;
	
	SelectedNoneView() {
		
		basePanel.setSize("100%", "100%");
		basePanel.add(selectedNoneLabel);
		this.initWidget(basePanel);
	}
	
	@Override
	public void setPresenter(Presenter presenter) {
		this.presenter = presenter;
	}

	@Override
	public void render(String queryDescription, int resultsSize) {
		if (resultsSize > 0) {
			selectedNoneLabel.setText("Query: " + queryDescription + 
					", resultsSize: " + resultsSize);			
		} else {
			selectedNoneLabel.setText("Your search - " + queryDescription + 
					" - did not match any documents.");
		}
	}
}
